package ucd.csi.comp30220.fall2011.oteop.demo;

import java.util.Date;

import ucd.csi.comp30220.fall2011.oteop.airline.AirlineInfo;
import ucd.csi.comp30220.fall2011.oteop.airline.impl.AirlineServer;
import ucd.csi.comp30220.fall2011.oteop.flight.FlightInfo;
import ucd.csi.comp30220.fall2011.oteop.flight.PlaneInfo;
import ucd.csi.comp30220.fall2011.oteop.flughafen.AirportFinder;

public class Airlines {
    
    private static PlaneInfo createPlaneInfo(int multiplier) {
        return new PlaneInfo(
            "Boeing 747-200",   // type
            45100,              // service ceiling
            35000,              // cruising altitude,
             2000 * multiplier, // rate of climb,
              522 * multiplier, // maximum speed
              100 * multiplier, // stall speed,
              490 * multiplier, // cruising speed
              180 * multiplier, // rotate speed,
              160 * multiplier, // approach speed,
              154 * multiplier, // landing speed,
             4880,              // range
            10500,              // take off distance,
             6170               // landing distance
        );
    }
    
    public static void main(String[] argv) throws Exception {
        int mult = argv.length > 0 ? Integer.parseInt(argv[0]) : 20;
        
        new AirlineServer(
            new AirlineInfo("BA", "British Airways"), 
            new FlightInfo[] {
                new FlightInfo(
                    "BA",
                    "BA1",
                    "Speedbird one",
                    createPlaneInfo(mult),
                    new Date(System.currentTimeMillis()+ 10*1000),
                    Servers.BL,
                    Servers.TR),
                new FlightInfo(
                    "BA",
                    "BA2",
                    "Speedbird two",
                    createPlaneInfo(mult),
                    new Date(System.currentTimeMillis()+ (10*1000)+1),
                    Servers.BR,
                    Servers.TL)
            });
        
    }

}
